package com.hspud.enum_;

import com.sun.org.apache.bcel.internal.generic.ANEWARRAY;

import javax.jws.Oneway;

public class Car {
    public double temperature;

    public Car(double temperature) {
        this.temperature = setTemperature(temperature);
    }
    private Double setTemperature(double temperature) {
        if (temperature < 70 && temperature > -50) {
            return this.temperature = temperature;
        }else{
            System.out.println("您的空调外设已故障，请检查维修");
        }
        return 1000.0;
    }

    class Air{
        public void flow(){
            if(temperature == 1000.0){
                return;
            }
            if(temperature > 40.0){
                System.out.println("吹冷气");
            }else if(temperature < 0.0){
                System.out.println("吹暖气");
            }else{
                System.out.println("关闭空调");
            }
        }

    }
}
